
<!DOCTYPE html>
<html lang="en" data-figures="" class="page">
  <head>
<title>SpringCloud | Alexzshl</title>
<meta charset="utf-8">
<meta name="generator" content="Hugo 0.80.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta property="og:locale" content="en" />

<meta property="og:type" content="article">
<meta name="description" content="Article description.">
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="">
<meta name="twitter:title" content="SpringCloud" />
<meta property="og:url" content="https://alexzshl.gitee.io/blog/post/springcloud/" />
<meta property="og:title" content="SpringCloud" />
<meta property="og:description" content="Article description." />
<meta property="og:image" content="https://alexzshl.gitee.io/blog/" />
<link rel="apple-touch-icon" sizes="180x180" href='https://alexzshl.gitee.io/blog/icons/apple-touch-icon.png'>
<link rel="icon" type="image/png" sizes="32x32" href='https://alexzshl.gitee.io/blog/icons/favicon-32x32.png'>
<link rel="manifest" href='https://alexzshl.gitee.io/blog/icons/site.webmanifest'>
<link rel="mask-icon" href='https://alexzshl.gitee.io/blog/safari-pinned-tab.svg' color="#002538">
<meta name="msapplication-TileColor" content="#002538">
<meta name="theme-color" content="#002538">

<link rel="canonical" href="https://alexzshl.gitee.io/blog/post/springcloud/">

    

    
    
    <link rel="preload" href="https://alexzshl.gitee.io/blog/css/styles.782bf96a82b3cc5b3cee4c47a42cc81321f16960a6d41fab3277c4abe047bc7ae044ea1bb7ae4d237c12baa0143e02f95969e5e8b6e68d9dcfd14158cfa244ac.css" integrity = "sha512-eCv5aoKzzFs87kxHpCzIEyHxaWCm1B&#43;rMnfEq&#43;BHvHrgROobt65NI3wSuqAUPgL5WWnl6LbmjZ3P0UFYz6JErA==" as="style" crossorigin="anonymous">
    <link rel="preload" href="https://alexzshl.gitee.io/blog/js/bundle.min.16ce52f0798f54d65cefb0a0fc9228cf99e0b73de57f8a1545fe14259265bf79ba12fe15afd2fd75d5f0bff8f416e8ca8c5c3458f87e014cbfbed8ccfdaee327.js" as="script" integrity=
    "sha512-Fs5S8HmPVNZc77Cg/JIoz5ngtz3lf4oVRf4UJZJlv3m6Ev4Vr9L9ddXwv/j0FujKjFw0WPh&#43;AUy/vtjM/a7jJw==" crossorigin="anonymous">

    
    <link rel="stylesheet" type="text/css" href="https://alexzshl.gitee.io/blog/css/styles.782bf96a82b3cc5b3cee4c47a42cc81321f16960a6d41fab3277c4abe047bc7ae044ea1bb7ae4d237c12baa0143e02f95969e5e8b6e68d9dcfd14158cfa244ac.css" integrity="sha512-eCv5aoKzzFs87kxHpCzIEyHxaWCm1B&#43;rMnfEq&#43;BHvHrgROobt65NI3wSuqAUPgL5WWnl6LbmjZ3P0UFYz6JErA==" crossorigin="anonymous">
    
  </head>
  
  
    
  
  <body data-code="100" data-lines="false" id="documentTop">

<header class="nav_header" >
  <nav class="nav">
    <a href='https://alexzshl.gitee.io/blog/' class="nav_brand nav_item">
        Alexzshl
      <div class="nav_close">
        <div>
          <svg class="icon">
  <use xlink:href="#open-menu"></use>
</svg>
          <svg class="icon">
  <use xlink:href="#closeme"></use>
</svg>
        </div>
      </div>
    </a>
    <div class='nav_body nav_body_'>
      
      
      
        

      
<div class='follow'>
<div class="color_mode">
  <input type="checkbox" class="color_choice" id="mode">
</div>

</div>

    </div>
  </nav>
</header>

    <main>
  
<div class="grid-inverse wrap content">
  <article class="post_content">
    <h1 class="post_title">SpringCloud</h1><div class="post_meta">
  
    <svg class="icon">
  <use xlink:href="#calendar"></use>
</svg>
    <span class="post_date">
      Oct 6, 2020</span>
      <a href='https://alexzshl.gitee.io/blog/tags/zookeeper' class="post_tag button button_translucent">zookeeper
      </a>
      <a href='https://alexzshl.gitee.io/blog/tags/eureka' class="post_tag button button_translucent">eureka
      </a>
      <a href='https://alexzshl.gitee.io/blog/tags/feign' class="post_tag button button_translucent">feign
      </a>
      <a href='https://alexzshl.gitee.io/blog/tags/hystrix' class="post_tag button button_translucent">hystrix
      </a>
      <a href='https://alexzshl.gitee.io/blog/tags/gateway' class="post_tag button button_translucent">gateway
      </a>
      <a href='https://alexzshl.gitee.io/blog/tags/springcloud-alibaba' class="post_tag button button_translucent">SpringCloud Alibaba
      </a>
      <a href='https://alexzshl.gitee.io/blog/tags/consul' class="post_tag button button_translucent">consul
      </a>
      <a href='https://alexzshl.gitee.io/blog/tags/nacos' class="post_tag button button_translucent">nacos
      </a>
</div>

    
  <div class="post_share">
    Share on:
    <a href="https://twitter.com/intent/tweet?text=SpringCloud&url=https%3a%2f%2falexzshl.gitee.io%2fblog%2fpost%2fspringcloud%2f&tw_p=tweetbutton" class="twitter" title="Share on Twitter" target="_blank" rel="nofollow">
      <svg class="icon">
  <use xlink:href="#twitter"></use>
</svg>
    </a>
    <a href="https://www.facebook.com/sharer.php?u=https%3a%2f%2falexzshl.gitee.io%2fblog%2fpost%2fspringcloud%2f&t=SpringCloud" class="facebook" title="Share on Facebook" target="_blank" rel="nofollow">
      <svg class="icon">
  <use xlink:href="#facebook"></use>
</svg>
    </a>
    <a href="#linkedinshare" id = "linkedinshare" class="linkedin" title="Share on LinkedIn" rel="nofollow">
      <svg class="icon">
  <use xlink:href="#linkedin"></use>
</svg>
    </a>
    <a href="https://alexzshl.gitee.io/blog/post/springcloud/" title="Copy Link" class="link link_yank">
      <svg class="icon">
  <use xlink:href="#copy"></use>
</svg>
    </a>
  </div>

    
    
    <h2>Overview</h2>
    <nav id="TableOfContents">
  <ul>
    <li><a href="#0-微服务架构零基础入门">0. 微服务架构零基础入门</a></li>
    <li><a href="#1-从22x和h版开始说起">1. 从2.2.x和H版开始说起</a></li>
    <li><a href="#2-关于cloud各种组件的停更升级替换">2. 关于cloud各种组件的停更/升级/替换</a></li>
    <li><a href="#3-微服务架构编码构建">3. 微服务架构编码构建</a></li>
    <li><a href="#4-eureka服务注册与发现">4. Eureka服务注册与发现</a>
      <ul>
        <li><a href="#eureka-基础知识">eureka 基础知识</a></li>
        <li><a href="#单机-eureka-构建步骤">单机 eureka 构建步骤</a></li>
        <li><a href="#集群-eureka-构建步骤">集群 eureka 构建步骤</a></li>
        <li><a href="#actuator-微服务信息完善">actuator 微服务信息完善</a></li>
        <li><a href="#服务发现-discovery">服务发现 Discovery</a></li>
        <li><a href="#eureka-自我保护">eureka 自我保护</a></li>
      </ul>
    </li>
    <li><a href="#5-zookeeper服务注册与发现">5. Zookeeper服务注册与发现</a></li>
    <li><a href="#6-consul服务注册与发现">6. Consul服务注册与发现</a></li>
    <li><a href="#7-ribbon负载均衡服务调用">7. Ribbon负载均衡服务调用</a></li>
    <li><a href="#8-openfeign服务接口调用">8. OpenFeign服务接口调用</a></li>
    <li><a href="#9-hystrix断路器">9. Hystrix断路器</a></li>
    <li><a href="#10-zuul路由网关">10. zuul路由网关</a></li>
    <li><a href="#11-gateway新一代网关">11. Gateway新一代网关</a></li>
    <li><a href="#12-spring-cloud-config-分布式配置中心">12. Spring Cloud Config 分布式配置中心</a></li>
    <li><a href="#13-spring-cloud-bus-消息总线">13. Spring Cloud Bus 消息总线</a></li>
    <li><a href="#14-spring-cloud-stream-消息驱动">14. Spring Cloud Stream 消息驱动</a></li>
    <li><a href="#15-spring-cloud-sleuth-分布式请求链路跟踪">15. Spring Cloud Sleuth 分布式请求链路跟踪</a></li>
    <li><a href="#16-spring-cloud-alibaba-入门简介">16. Spring Cloud Alibaba 入门简介</a></li>
    <li><a href="#17-spring-cloud-alibaba-nacos-服务注册和配置中心">17. Spring Cloud Alibaba Nacos 服务注册和配置中心</a></li>
    <li><a href="#18-spring-cloud-alibaba-sentinel-实现熔断与限流">18. Spring Cloud Alibaba Sentinel 实现熔断与限流</a></li>
    <li><a href="#19-spring-cloud-alibaba-seata-处理分布式事务">19. Spring Cloud Alibaba Seata 处理分布式事务</a></li>
    <li><a href="#20-大厂面试题第三季">20. 大厂面试题第三季</a></li>
  </ul>
</nav>
    <h2 id="0-微服务架构零基础入门">0. 微服务架构零基础入门</h2>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210308203537860.png" alt="image-20210308203537860"></p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210308203805989.png" alt="image-20210308203805989"></p>
<h2 id="1-从22x和h版开始说起">1. 从2.2.x和H版开始说起</h2>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210308204617854.png" alt="image-20210308204617854"></p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210308205156308.png" alt="image-20210308205156308"></p>
<h2 id="2-关于cloud各种组件的停更升级替换">2. 关于cloud各种组件的停更/升级/替换</h2>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210308210041428.png" alt="image-20210308210041428"></p>
<h2 id="3-微服务架构编码构建">3. 微服务架构编码构建</h2>
<blockquote>
<p>约定 &gt; 配置 &gt; 编码</p>
</blockquote>
<p>父工程: Maven-archetype-site</p>
<p>packing: pom</p>
<p>pom-proterties 和 dependencyManagement 的使用</p>
<p>关闭 maven-test生命周期</p>
<p>可以 mvn install 安装父工程至仓库给其他木块使用</p>
<p>pom.xml:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-xml" data-lang="xml"><span style="color:#75715e">&lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&gt;</span>

<span style="color:#f92672">&lt;project</span> <span style="color:#a6e22e">xmlns=</span><span style="color:#e6db74">&#34;http://maven.apache.org/POM/4.0.0&#34;</span> <span style="color:#a6e22e">xmlns:xsi=</span><span style="color:#e6db74">&#34;http://www.w3.org/2001/XMLSchema-instance&#34;</span>
  <span style="color:#a6e22e">xsi:schemaLocation=</span><span style="color:#e6db74">&#34;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&#34;</span><span style="color:#f92672">&gt;</span>
  <span style="color:#f92672">&lt;modelVersion&gt;</span>4.0.0<span style="color:#f92672">&lt;/modelVersion&gt;</span>

  <span style="color:#f92672">&lt;groupId&gt;</span>com.atguigu.springcloud<span style="color:#f92672">&lt;/groupId&gt;</span>
  <span style="color:#f92672">&lt;artifactId&gt;</span>learn-springcloud-atguigu-2020<span style="color:#f92672">&lt;/artifactId&gt;</span>
  <span style="color:#f92672">&lt;version&gt;</span>1.0-SNAPSHOT<span style="color:#f92672">&lt;/version&gt;</span>
  <span style="color:#f92672">&lt;packaging&gt;</span>pom<span style="color:#f92672">&lt;/packaging&gt;</span>

  <span style="color:#f92672">&lt;properties&gt;</span>
    <span style="color:#f92672">&lt;project.build.sourceEncoding&gt;</span>UTF-8<span style="color:#f92672">&lt;/project.build.sourceEncoding&gt;</span>
    <span style="color:#f92672">&lt;maven.compiler.source&gt;</span>1.8<span style="color:#f92672">&lt;/maven.compiler.source&gt;</span>
    <span style="color:#f92672">&lt;maven.compiler.target&gt;</span>1.8<span style="color:#f92672">&lt;/maven.compiler.target&gt;</span>
    <span style="color:#f92672">&lt;junit.version&gt;</span>4.12<span style="color:#f92672">&lt;/junit.version&gt;</span>
    <span style="color:#f92672">&lt;log4j.version&gt;</span>1.2.17<span style="color:#f92672">&lt;/log4j.version&gt;</span>
    <span style="color:#f92672">&lt;lombok.version&gt;</span>1.16.18<span style="color:#f92672">&lt;/lombok.version&gt;</span>
    <span style="color:#f92672">&lt;mysql.version&gt;</span>5.1.47<span style="color:#f92672">&lt;/mysql.version&gt;</span>
    <span style="color:#f92672">&lt;druid.version&gt;</span>1.1.16<span style="color:#f92672">&lt;/druid.version&gt;</span>
    <span style="color:#f92672">&lt;mybatis.spring.boot.version&gt;</span>1.3.0<span style="color:#f92672">&lt;/mybatis.spring.boot.version&gt;</span>
  <span style="color:#f92672">&lt;/properties&gt;</span>

  <span style="color:#f92672">&lt;dependencyManagement&gt;</span>
    <span style="color:#f92672">&lt;dependencies&gt;</span>
      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-dependencies<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>2.2.2.RELEASE<span style="color:#f92672">&lt;/version&gt;</span>
        <span style="color:#f92672">&lt;type&gt;</span>pom<span style="color:#f92672">&lt;/type&gt;</span>
        <span style="color:#f92672">&lt;scope&gt;</span>import<span style="color:#f92672">&lt;/scope&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>
      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.cloud<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>spring-cloud-dependencies<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>Hoxton.SR1<span style="color:#f92672">&lt;/version&gt;</span>
        <span style="color:#f92672">&lt;type&gt;</span>pom<span style="color:#f92672">&lt;/type&gt;</span>
        <span style="color:#f92672">&lt;scope&gt;</span>import<span style="color:#f92672">&lt;/scope&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>
      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>com.alibaba.cloud<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>spring-cloud-alibaba-dependencies<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>2.1.0.RELEASE<span style="color:#f92672">&lt;/version&gt;</span>
        <span style="color:#f92672">&lt;type&gt;</span>pom<span style="color:#f92672">&lt;/type&gt;</span>
        <span style="color:#f92672">&lt;scope&gt;</span>import<span style="color:#f92672">&lt;/scope&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>

      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>mysql<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>mysql-connector-java<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>${mysql.version}<span style="color:#f92672">&lt;/version&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>
      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>com.alibaba<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>druid<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>${druid.version}<span style="color:#f92672">&lt;/version&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>
      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>org.mybatis.spring.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>mybatis-spring-boot-starter<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>${mybatis.spring.boot.version}<span style="color:#f92672">&lt;/version&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>

      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>junit<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>junit<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>${junit.version}<span style="color:#f92672">&lt;/version&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>
      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>log4j<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>log4j<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>${log4j.version}<span style="color:#f92672">&lt;/version&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>
      <span style="color:#f92672">&lt;dependency&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>org.projectlombok<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>lombok<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;version&gt;</span>${lombok.version}<span style="color:#f92672">&lt;/version&gt;</span>
        <span style="color:#f92672">&lt;optional&gt;</span>true<span style="color:#f92672">&lt;/optional&gt;</span>
      <span style="color:#f92672">&lt;/dependency&gt;</span>
    <span style="color:#f92672">&lt;/dependencies&gt;</span>
  <span style="color:#f92672">&lt;/dependencyManagement&gt;</span>

  <span style="color:#f92672">&lt;build&gt;</span>
    <span style="color:#f92672">&lt;plugins&gt;</span>
      <span style="color:#f92672">&lt;plugin&gt;</span>
        <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.boot<span style="color:#f92672">&lt;/groupId&gt;</span>
        <span style="color:#f92672">&lt;artifactId&gt;</span>spring-boot-maven-plugin<span style="color:#f92672">&lt;/artifactId&gt;</span>
        <span style="color:#f92672">&lt;configuration&gt;</span>
          <span style="color:#f92672">&lt;excludes&gt;</span>
            <span style="color:#f92672">&lt;exclude&gt;</span>
              <span style="color:#f92672">&lt;groupId&gt;</span>org.projectlombok<span style="color:#f92672">&lt;/groupId&gt;</span>
              <span style="color:#f92672">&lt;artifactId&gt;</span>lombok<span style="color:#f92672">&lt;/artifactId&gt;</span>
            <span style="color:#f92672">&lt;/exclude&gt;</span>
          <span style="color:#f92672">&lt;/excludes&gt;</span>
        <span style="color:#f92672">&lt;/configuration&gt;</span>
      <span style="color:#f92672">&lt;/plugin&gt;</span>
    <span style="color:#f92672">&lt;/plugins&gt;</span>
  <span style="color:#f92672">&lt;/build&gt;</span>
<span style="color:#f92672">&lt;/project&gt;</span>

</code></pre></div><p>父工程只需要一个pom文件</p>
<p>开发流程介绍:</p>
<p>vue   -   controller-service-dao-mysql</p>
<p>构建微服务模块:</p>
<ol>
<li>新建 module</li>
<li>编辑 pom</li>
<li>编辑 application.yml</li>
<li>主启动</li>
<li>业务类</li>
</ol>
<p>module: cloud-provider-payment8001</p>
<p>module: cloud-consumer-order80</p>
<p>业务类:</p>
<ol>
<li>
<p>建表 SQL</p>
</li>
<li>
<p>entities</p>
</li>
<li>
<p>dao</p>
</li>
<li>
<p>service</p>
</li>
<li>
<p>controller</p>
</li>
</ol>
<p>考虑模块的公共部分:</p>
<p>例如, 一般 entities 会单独放在一个 api 模块里, 这个模块不是web模块, 也不与数据库等交互. 一般是一些单纯的java类或者bean</p>
<p>工具类(可以直接使用hutool)等</p>
<h2 id="4-eureka服务注册与发现">4. Eureka服务注册与发现</h2>
<p>对大量微服务进行统一的调度和管理</p>
<p>服务调用方面, 可以改由通过注册的application-name来调用, 而不必耦合 host:port, 可以减少代码耦合度</p>
<h3 id="eureka-基础知识">eureka 基础知识</h3>
<p>心跳检测 节点移除(默认90秒)</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210309112823935.png" alt="image-20210309112823935"></p>
<h3 id="单机-eureka-构建步骤">单机 eureka 构建步骤</h3>
<p>新建子module: cloud-eureka-server7001</p>
<p>核心依赖:</p>
<blockquote>
<p>spring-cloud-starter-netflix-eureka-server</p>
<p>spring-boot-starter-web</p>
<p>spring-boot-starter-actuator</p>
</blockquote>
<p>核心注解: <code>@EnableEurekaServer</code> (修饰启动类/配置类)</p>
<p>端口: 7001</p>
<p>application.yml:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">server</span>:
  <span style="color:#f92672">port</span>: <span style="color:#ae81ff">7001</span>

<span style="color:#f92672">spring</span>:
  <span style="color:#f92672">application</span>:
    <span style="color:#f92672">name</span>: <span style="color:#ae81ff">eureka-server</span>
<span style="color:#f92672">eureka</span>:
  <span style="color:#f92672">instance</span>:
    <span style="color:#f92672">hostname</span>: <span style="color:#ae81ff">localhost</span>

  <span style="color:#f92672">client</span>:
    <span style="color:#f92672">register-with-eureka</span>: <span style="color:#66d9ef">false</span>
    <span style="color:#f92672">fetch-registry</span>: <span style="color:#66d9ef">false</span>
    <span style="color:#f92672">service-url</span>:
      <span style="color:#f92672">defaultZone</span>: <span style="color:#ae81ff">http://${eureka.instance.hostname}:${server.port}/eureka/</span>
</code></pre></div><p>微服务(provider 和 consumer)集成 eureka-client</p>
<p>添加依赖: spring-cloud-starter-netflix-eureka-client</p>
<p>配置yml: 开启服务注册/服务发现, 配置注册中心地址</p>
<p>配置主启动类: @EnableEurekaClient</p>
<h3 id="集群-eureka-构建步骤">集群 eureka 构建步骤</h3>
<p>eureka server: defaultZone 配置其他多个服务器地址(yml以逗号分隔)</p>
<p>provider和consumer: defaultZone 配置所有服务器地址</p>
<p>service集群:</p>
<p>这里指的是一个provider启动多个实例, 通过多个配置文件(一般是修改端口号即可)启动</p>
<p>consumer 调用service的方式改变:</p>
<p>在resttemplate bean 上添加负载均衡注解 @LoadBalanced 后, 可以通过 service-name/&hellip; 方式调用service, service-name取代单机版的 host:port. service-name不区分大小写</p>
<h3 id="actuator-微服务信息完善">actuator 微服务信息完善</h3>
<p>微服务实例名称修改(即eureka server中显式的 status):</p>
<p>鼠标悬浮在实例名称上时显示url地址:</p>
<h3 id="服务发现-discovery">服务发现 Discovery</h3>
<p>@EnableDiscoveryClient</p>
<p>作用是允许被其他服务获取自己的服务信息(通过 DiscoverClient bean获取)</p>
<h3 id="eureka-自我保护">eureka 自我保护</h3>
<p>某时候微服务不可用了, eureka 不会立即清除 instance, 而是保留一段时间(默认90秒), 超时后才真正清除服务实例信息 (保证高可用)</p>
<p>eureka 的设计理念属于 CAP 里面的 AP 类型</p>
<p>CAP:</p>
<p>C: 一致性</p>
<p>A: 高可用性</p>
<p>P: 容错性</p>
<h2 id="5-zookeeper服务注册与发现">5. Zookeeper服务注册与发现</h2>
<p>优于 eureka 2.0 停更, 需要寻找其他可替代的服务注册中心</p>
<p>启动 zookeeper 服务: 47.115.139.117:2181</p>
<p>由于zookeeper是一个软件, 所以springcloud中只需要client注册微服务:</p>
<blockquote>
<p>spring-cloud-starter-zookeeper-discovery</p>
</blockquote>
<p>准备一个provider, 将 eureka-client 替换为以下:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-xml" data-lang="xml"><span style="color:#f92672">&lt;dependency&gt;</span>
            <span style="color:#f92672">&lt;groupId&gt;</span>org.springframework.cloud<span style="color:#f92672">&lt;/groupId&gt;</span>
            <span style="color:#f92672">&lt;artifactId&gt;</span>spring-cloud-starter-zookeeper-discovery<span style="color:#f92672">&lt;/artifactId&gt;</span>
            <span style="color:#f92672">&lt;exclusions&gt;</span>
                <span style="color:#f92672">&lt;exclusion&gt;</span>
                    <span style="color:#f92672">&lt;groupId&gt;</span>org.apache.zookeeper<span style="color:#f92672">&lt;/groupId&gt;</span>
                    <span style="color:#f92672">&lt;artifactId&gt;</span>zookeeper<span style="color:#f92672">&lt;/artifactId&gt;</span>
                <span style="color:#f92672">&lt;/exclusion&gt;</span>
            <span style="color:#f92672">&lt;/exclusions&gt;</span>
        <span style="color:#f92672">&lt;/dependency&gt;</span>
        <span style="color:#f92672">&lt;dependency&gt;</span>
            <span style="color:#f92672">&lt;groupId&gt;</span>org.apache.zookeeper<span style="color:#f92672">&lt;/groupId&gt;</span>
            <span style="color:#f92672">&lt;artifactId&gt;</span>zookeeper<span style="color:#f92672">&lt;/artifactId&gt;</span>
            <span style="color:#f92672">&lt;version&gt;</span>3.6.2<span style="color:#f92672">&lt;/version&gt;</span>
            <span style="color:#f92672">&lt;exclusions&gt;</span>
                <span style="color:#f92672">&lt;exclusion&gt;</span>
                    <span style="color:#f92672">&lt;groupId&gt;</span>org.slf4j<span style="color:#f92672">&lt;/groupId&gt;</span>
                    <span style="color:#f92672">&lt;artifactId&gt;</span>slf4j-log4j12<span style="color:#f92672">&lt;/artifactId&gt;</span>
                <span style="color:#f92672">&lt;/exclusion&gt;</span>
            <span style="color:#f92672">&lt;/exclusions&gt;</span>
        <span style="color:#f92672">&lt;/dependency&gt;</span>
</code></pre></div><p>配置文件配置zookeeper服务器地址:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">spring</span>:
  <span style="color:#f92672">cloud</span>:
    <span style="color:#f92672">zookeeper</span>:
      <span style="color:#f92672">connect-string</span>: <span style="color:#ae81ff">47.115.139.117</span>:<span style="color:#ae81ff">2181</span>
</code></pre></div><p>主启动类注解: @EnableDiscoveryClient</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">docker exec -it zookeeper /bin/bash
cd bin
./zkCli.sh
ls /
ls /services
ls /services/cloud-payment-service
<span style="color:#75715e"># 得到实例id</span>
get /services/cloud-payment-service/<span style="color:#f92672">[</span>instance-id<span style="color:#f92672">]</span>
将返回的json字符串使用在线json工具<span style="color:#f92672">(</span>tool.lu<span style="color:#f92672">)</span>格式化
</code></pre></div><p>consumer 模块同上, @LoadBlanced 和 服务名调用依然可以在zk中使用</p>
<h2 id="6-consul服务注册与发现">6. Consul服务注册与发现</h2>
<p>Consul是一种服务网格解决方案，提供具有服务发现，配置和分段功能的全功能控制平面。这些功能中的每一个都可以根据需要单独使用，也可以一起使用以构建完整的服务网格。Consul需要一个数据平面，并支持代理和本机集成模型。Consul附带了一个简单的内置代理，因此一切都可以直接使用，还支持Envoy等第三方代理集成。</p>
<p>领事的主要特点是：</p>
<ul>
<li><strong>服务发现</strong>：Consul的客户端可以注册服务，例如 <code>api</code>或<code>mysql</code>，其他客户端可以使用Consul来发现给定服务的提供者。使用DNS或HTTP，应用程序可以轻松找到它们依赖的服务。</li>
<li><strong>运行状况检查</strong>：领事客户端可以提供任何数量的运行状况检查，这些检查可以与给定服务（“ Web服务器是否返回200 OK”）或与本地节点（“内存利用率低于90％”）相关联。操作员可以使用此信息来监视群集的运行状况，服务发现组件可以使用此信息将流量路由到运行状况不佳的主机之外。</li>
<li><strong>KV商店</strong>：应用程序可以将Consul的分层键/值存储用于多种目的，包括动态配置，功能标记，协调，领导者选举等。简单的HTTP API使其易于使用。</li>
<li><strong>安全的服务通信</strong>：Consul可以为服务生成和分发TLS证书，以建立相互TLS连接。 <a href="https://www.consul.io/docs/connect/intentions">意图</a> 可用于定义允许哪些服务进行通信。可以使用可以实时更改的意图轻松管理服务分段，而不用使用复杂的网络拓扑和静态防火墙规则。</li>
<li><strong>多数据中心</strong>：Consul开箱即用地支持多个数据中心。这意味着Consul的用户不必担心会构建其他抽象层以扩展到多个区域。</li>
</ul>
<p>Consul旨在对DevOps社区和应用程序开发人员友好，使其非常适合现代，灵活的基础架构。</p>
<p>Consul是一个分布式的，高度可用的系统。本节将介绍基础知识，有意省略一些不必要的细节，因此您可以快速了解Consul的工作方式。</p>
<p><a href="https://www.consul.io/docs/intro">https://www.consul.io/docs/intro</a></p>
<p><a href="https://www.springcloud.cc/spring-cloud-consul.html">https://www.springcloud.cc/spring-cloud-consul.html</a></p>
<p>下载安装(单个文件, 无需安装)</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">consul -v

<span style="color:#75715e"># 开发模式启动</span>
consul agent -dev
</code></pre></div><p>访问: http://localhost:8500</p>
<p>与springboot集成: spring-cloud-starter-consul</p>
<p>配置:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">spring</span>:
  <span style="color:#f92672">cloud</span>:
    <span style="color:#f92672">consul</span>:
      <span style="color:#f92672">host</span>: <span style="color:#ae81ff">localhost</span>
      <span style="color:#f92672">port</span>: <span style="color:#ae81ff">8500</span>
      <span style="color:#f92672">discovery</span>:
        <span style="color:#f92672">service-name</span>: <span style="color:#ae81ff">${spring.application.name}</span>
</code></pre></div><p>@EnableDiscoveryClient 服务注册和发现</p>
<p>负载均衡</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#a6e22e">@Bean</span>
<span style="color:#a6e22e">@LoadBalanced</span>
<span style="color:#66d9ef">public</span> RestTemplate <span style="color:#a6e22e">getRestTemplate</span><span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
        <span style="color:#66d9ef">return</span> <span style="color:#66d9ef">new</span> RestTemplate<span style="color:#f92672">();</span>
    <span style="color:#f92672">}</span>
</code></pre></div><p>三个注册中心异同点:</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210309222657564.png" alt="image-20210309222657564"></p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210309222755331.png" alt="image-20210309222755331"></p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210309222840553.png" alt="image-20210309222840553"></p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210309223018419.png" alt="image-20210309223018419"></p>
<h2 id="7-ribbon负载均衡服务调用">7. Ribbon负载均衡服务调用</h2>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210309223758768.png" alt="image-20210309223758768"></p>
<p>Ribbon 是进程式负载均衡, 由消费方实现</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210309224325150.png" alt="image-20210309224325150"></p>
<p>eureka-client 自带 ribbon 和 loadbalancer</p>
<p>Ribbon 核心组件: IRule</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210309230534365.png" alt="image-20210309230534365"></p>
<p>负载均衡算法:</p>
<h2 id="8-openfeign服务接口调用">8. OpenFeign服务接口调用</h2>
<p>Feign 已停止更新, 不需要深入学习</p>
<p>OpenFeign是因为Feign停止更新由spring团队基于Feign推出的, 基本和Feign一样</p>
<p>Feign 是用 接口+@GetMapping等路由+注解来简化restTemplate的使用(服务调用), 使得更加简练和符合后端开发人员的习惯</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210310095106959.png" alt="image-20210310095106959"></p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210310095214353.png" alt="image-20210310095214353"></p>
<p>可以理解为 feign 是对 restTemplate 的更高程度的封装</p>
<p>本质是基于接口的动态代理</p>
<p>步骤:</p>
<p>准备一个consumer</p>
<p>增加依赖: spring-cloud-starter-openfeign</p>
<p>新增配置: 无</p>
<p>主启动类注解: @EnableFeignClients 作用是开启feign(扫描@FeignClient接口)</p>
<p>openfeign 超时设置</p>
<p>openfeign 默认只等待1秒钟,超时就会报错</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">ribbon</span>:
  <span style="color:#f92672">ConnectTimeout</span>: <span style="color:#ae81ff">5000</span>
  <span style="color:#f92672">ReadTimeout</span>: <span style="color:#ae81ff">5000</span>
</code></pre></div><p>openfeign 日志打印</p>
<p>日志级别:</p>
<p>NONE(默认)</p>
<p>BASIC</p>
<p>HEADERS</p>
<p>FULL</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210310110503788.png" alt="image-20210310110503788"></p>
<p>注册bean-日志类型</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#f92672">import</span> feign.Logger<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> org.springframework.context.annotation.Bean<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> org.springframework.context.annotation.Configuration<span style="color:#f92672">;</span>

<span style="color:#a6e22e">@Configuration</span>
<span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">OpenFeignConfig</span> <span style="color:#f92672">{</span>

    <span style="color:#a6e22e">@Bean</span>
    Logger<span style="color:#f92672">.</span><span style="color:#a6e22e">Level</span> <span style="color:#a6e22e">feignLoggerLevel</span><span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
        <span style="color:#66d9ef">return</span> Logger<span style="color:#f92672">.</span><span style="color:#a6e22e">Level</span><span style="color:#f92672">.</span><span style="color:#a6e22e">BASIC</span><span style="color:#f92672">;</span>
    <span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>
</code></pre></div><p>给 FeignClient 类添加日志级别:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">logging</span>:
  <span style="color:#f92672">level</span>:
    <span style="color:#f92672">com.atguigu.springcloud.service.PaymentFeignService</span>: <span style="color:#ae81ff">debug</span>
</code></pre></div><h2 id="9-hystrix断路器">9. Hystrix断路器</h2>
<p>Hystrix 已经停止更新, 但是目前依然是用的最多的</p>
<p>另外推荐alibaba的<code>sentinel</code></p>
<p>断路器</p>
<p>备选响应(callback)</p>
<p>能干什么:</p>
<p>服务降级 fallback</p>
<p>服务熔断 break</p>
<p>服务限流 flowlimit</p>
<p>接近实时的监控(hystrix dashboard)</p>
<p>&hellip;</p>
<p>服务降级:</p>
<p>服务器忙, 请稍后再试, 不让客户端等待并立刻返回一个友好提示, fallback</p>
<p>哪些情况会触发降级:</p>
<p>程序运行异常</p>
<p>超时</p>
<p>服务熔断触发服务降级</p>
<p>线程池/信号量打满也会导致服务降级</p>
<p>服务熔断:</p>
<p>类比保险丝达到最大服务访问后, 直接拒绝访问, 拉闸限电, 然后调用服务降级的方法并返回友好提示</p>
<p>就是保险丝</p>
<p>服务限流:</p>
<p>秒杀高并发等操作, 严禁一窝蜂的过来拥挤, 大家排队, 一秒钟N个, 有序进行</p>
<p>消费方服务降级:</p>
<p>如果服务方自己的controller发生了异常, 对于消费方而言, 表现为等待一段时间(默认2s)后页面报500(连接超时错误, 这个错误是由feign抛出的)</p>
<p>消费方默认使用feign的情况下,  如果服务方的controller执行时间过长, 对于消费方的controller而言也会报500错误, 同样原因是超时, 虽然可能服务方本身并没有错误(比如3秒后返回结果)</p>
<p>还有一种情况就是主动关闭了服务方的微服务, 此时所有的消费方对服务方的调用地址都会报500错误, 而且每次请求默认等待2s(页面缓存后可能不需要等待)</p>
<p>服务熔断:</p>
<p>Hystrix 会监控微服务间调用的状况, 当失败的调用到一定阈值, 缺省是5秒内20次调用失败, 就会启动熔断机制. 熔断机制的注解是 @HystrixCommand</p>
<p>启用熔断也是注解: @CircuitBreaker</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210311112050233.png" alt="image-20210311112050233"></p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#75715e">// 服务熔断
</span><span style="color:#75715e"></span>    <span style="color:#a6e22e">@HystrixCommand</span><span style="color:#f92672">(</span>fallbackMethod <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;paymentCircuitBreaker_fallback&#34;</span><span style="color:#f92672">,</span> commandProperties <span style="color:#f92672">=</span> <span style="color:#f92672">{</span>
            <span style="color:#a6e22e">@HystrixProperty</span><span style="color:#f92672">(</span>name <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;circuitBreaker.enabled&#34;</span><span style="color:#f92672">,</span> value <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;true&#34;</span><span style="color:#f92672">),</span> <span style="color:#75715e">// 是否开启断路器
</span><span style="color:#75715e"></span>            <span style="color:#a6e22e">@HystrixProperty</span><span style="color:#f92672">(</span>name <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;circuitBreaker.requestVolumeThreshold&#34;</span><span style="color:#f92672">,</span> value <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;10&#34;</span><span style="color:#f92672">),</span> <span style="color:#75715e">// 请求次数
</span><span style="color:#75715e"></span>            <span style="color:#a6e22e">@HystrixProperty</span><span style="color:#f92672">(</span>name <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;circuitBreaker.sleepWindowInMilliseconds&#34;</span><span style="color:#f92672">,</span> value <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;10000&#34;</span><span style="color:#f92672">),</span> <span style="color:#75715e">// 时间范围
</span><span style="color:#75715e"></span>            <span style="color:#a6e22e">@HystrixProperty</span><span style="color:#f92672">(</span>name <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;circuitBreaker.errorThresholdPercentage&#34;</span><span style="color:#f92672">,</span> value <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;60&#34;</span><span style="color:#f92672">)</span> <span style="color:#75715e">// 失败后率达到多少百分比开始跳闸
</span><span style="color:#75715e"></span>    <span style="color:#f92672">})</span>
    <span style="color:#a6e22e">@GetMapping</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;/payment/circuit/{id}&#34;</span><span style="color:#f92672">)</span>
    <span style="color:#66d9ef">public</span> String <span style="color:#a6e22e">paymentCircuitBreaker</span><span style="color:#f92672">(</span><span style="color:#a6e22e">@PathVariable</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;id&#34;</span><span style="color:#f92672">)</span> Integer id<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
        <span style="color:#66d9ef">if</span> <span style="color:#f92672">(</span>id <span style="color:#f92672">&lt;</span> 0<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
            <span style="color:#66d9ef">throw</span> <span style="color:#66d9ef">new</span> RuntimeException<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;***** id 不能为负数&#34;</span><span style="color:#f92672">);</span>
        <span style="color:#f92672">}</span>
        String serialNumber <span style="color:#f92672">=</span> IdUtil<span style="color:#f92672">.</span><span style="color:#a6e22e">simpleUUID</span><span style="color:#f92672">();</span>
        <span style="color:#66d9ef">return</span> Thread<span style="color:#f92672">.</span><span style="color:#a6e22e">currentThread</span><span style="color:#f92672">().</span><span style="color:#a6e22e">getName</span><span style="color:#f92672">()</span> <span style="color:#f92672">+</span> <span style="color:#e6db74">&#34;\t&#34;</span> <span style="color:#f92672">+</span> <span style="color:#e6db74">&#34;调用成功, 流水号: &#34;</span> <span style="color:#f92672">+</span> serialNumber<span style="color:#f92672">;</span>
    <span style="color:#f92672">}</span>

    <span style="color:#66d9ef">public</span> String <span style="color:#a6e22e">paymentCircuitBreaker_fallback</span><span style="color:#f92672">(</span><span style="color:#a6e22e">@PathVariable</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;id&#34;</span><span style="color:#f92672">)</span> Integer id<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
        <span style="color:#66d9ef">return</span> <span style="color:#e6db74">&#34;id 不能负数, 请稍后再试... &#34;</span> <span style="color:#f92672">+</span> id<span style="color:#f92672">;</span>
    <span style="color:#f92672">}</span>
</code></pre></div><p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210311112331269.png" alt="image-20210311112331269"></p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210311112528388.png" alt="image-20210311112528388"></p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/hystrix-command-flow-chart-640.png" alt="img"></p>
<p>HystrixDashboard 9001</p>
<p>http://localhost:9001/hystrix</p>
<p>配置 8001 启动类:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#a6e22e">@Bean</span>
<span style="color:#66d9ef">public</span> ServletRegistrationBean <span style="color:#a6e22e">getServlet</span><span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
    HystrixMetricsStreamServlet streamServlet <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> HystrixMetricsStreamServlet<span style="color:#f92672">();</span>
    ServletRegistrationBean registrationBean <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> ServletRegistrationBean<span style="color:#f92672">(</span>streamServlet<span style="color:#f92672">);</span>
    registrationBean<span style="color:#f92672">.</span><span style="color:#a6e22e">setLoadOnStartup</span><span style="color:#f92672">(</span>1<span style="color:#f92672">);</span>
    registrationBean<span style="color:#f92672">.</span><span style="color:#a6e22e">addUrlMappings</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;/hystrix.stream&#34;</span><span style="color:#f92672">);</span>
    registrationBean<span style="color:#f92672">.</span><span style="color:#a6e22e">setName</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;HystrixMetricsStreamServlet&#34;</span><span style="color:#f92672">);</span>
    <span style="color:#66d9ef">return</span> registrationBean<span style="color:#f92672">;</span>
<span style="color:#f92672">}</span>
</code></pre></div><p>监控地址: http://localhost:8001/hystrix.stream</p>
<h2 id="10-zuul路由网关">10. zuul路由网关</h2>
<p>不作建议</p>
<h2 id="11-gateway新一代网关">11. Gateway新一代网关</h2>
<p>predicate 断言 支持函数式编程 可以匹配http请求所有内容(例如请求头和请求体)</p>
<p>filter 过滤 GatewayFilter 过滤路径</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210312100603786.png" alt="image-20210312100603786"></p>
<p>gateway是对provider访问的统一管理, 供 consumer 使用</p>
<p>配置方式:</p>
<p>配置yml文件(建议)</p>
<p>配置bean</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210312104328769.png" alt="image-20210312104328769"></p>
<h2 id="12-spring-cloud-config-分布式配置中心">12. Spring Cloud Config 分布式配置中心</h2>
<p>常用配置中心:</p>
<p>携程的 appolo</p>
<p>spring config</p>
<p>alibaba的 nacos</p>
<p>config-server</p>
<p>依赖: spring-cloud-config-server</p>
<p>注解: @EnableConfigServer</p>
<p>配置: application.yml</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">server</span>:
  <span style="color:#f92672">port</span>: <span style="color:#ae81ff">3344</span>
  <span style="color:#f92672">cloud</span>:
    <span style="color:#f92672">config</span>:
      <span style="color:#f92672">server</span>:
        <span style="color:#f92672">git</span>:
          <span style="color:#f92672">uri</span>: <span style="color:#ae81ff">https://github.com/alexzshl/springcloud-config.git</span>
          <span style="color:#f92672">default-label</span>: <span style="color:#ae81ff">main</span>
</code></pre></div><p>config-client:</p>
<p>依赖: spring-cloud-config-server</p>
<p>注解: 无</p>
<p>配置: bootstrap.yml</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">spring</span>:
  <span style="color:#f92672">cloud</span>:
    <span style="color:#f92672">config</span>:
      <span style="color:#f92672">uri</span>: <span style="color:#ae81ff">http://localhost:3344</span>
      <span style="color:#f92672">label</span>: <span style="color:#ae81ff">main</span>
      <span style="color:#f92672">name</span>: <span style="color:#ae81ff">provider</span>
      <span style="color:#f92672">profile</span>: <span style="color:#ae81ff">dev</span>
</code></pre></div><p>修改配置后如何不重启更新config-client(provider)提供的服务:</p>
<p>config-client 必须引入 spring-boot-starter-actuator</p>
<p>使用了配置信息的类(@Value)添加注解 @RefreshScope</p>
<p>bootstrap.yml 添加配置:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">management</span>:
  <span style="color:#f92672">endpoints</span>:
    <span style="color:#f92672">web</span>:
      <span style="color:#f92672">exposure</span>:
        <span style="color:#f92672">include</span>: <span style="color:#e6db74">&#34;*&#34;</span>
</code></pre></div><p>运维修改gti remote上面的配置文件后, 还需要发送一次post请求通知 config-client 更新数据:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl -X POST <span style="color:#e6db74">&#34;http://localhost:8082/actuator/refresh&#34;</span>
</code></pre></div><h2 id="13-spring-cloud-bus-消息总线">13. Spring Cloud Bus 消息总线</h2>
<p>Bus 支持两种消息代理 RabbitMQ / Kafka</p>
<p>首先在 linux 服务器上通过 docker 安装 RabbitMQ并启动</p>
<p>config-server</p>
<p>添加依赖: spring-cloud-starter-bus-amqp</p>
<p>添加配置:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">spring</span>:
  <span style="color:#f92672">rabbitmq</span>:
    <span style="color:#f92672">host</span>: <span style="color:#ae81ff">47.115.139.117</span>
    <span style="color:#f92672">username</span>: <span style="color:#ae81ff">guest</span>
    <span style="color:#f92672">password</span>: <span style="color:#ae81ff">guest</span>
    <span style="color:#f92672">port</span>: <span style="color:#ae81ff">5672</span>

<span style="color:#f92672">management</span>:
  <span style="color:#f92672">endpoints</span>:
    <span style="color:#f92672">web</span>:
      <span style="color:#f92672">exposure</span>:
        <span style="color:#f92672">include</span>: <span style="color:#e6db74">&#39;bus-refresh&#39;</span>
</code></pre></div><p>客户端同理, 但是监控端口改为 &ldquo;*&rdquo;</p>
<p>修改远程配置文件后, 向 config-server 发送bus-refsh消息请求, 所有的cofnig-client都会更新自己的配置</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl -X POST <span style="color:#e6db74">&#34;http://localhost:3344/actuator/bus-refresh&#34;</span>
</code></pre></div><p>定点刷新:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl -X POST <span style="color:#e6db74">&#34;http://localhost:3344/actuator/bus-refresh/cloud-config-client:8082&#34;</span>
</code></pre></div><h2 id="14-spring-cloud-stream-消息驱动">14. Spring Cloud Stream 消息驱动</h2>
<p>有没有一种新的技术诞生, 让我们不再关注具体MQ的细节, 我们只需要用一种适配绑定的方式, 自动的给我们的各种MQ内切换</p>
<p>cloud-stream: 屏蔽底层消息中间件的差异, 降低切换成本, 统一消息的编程模型</p>
<p>类似于日志门面的设计. stream提供一套统一的接口, 程序员只与stream打交道, stream底层则自动适配当前使用的消息中间件.</p>
<p>目前仅支持: RabbitMQ / Kafka</p>
<p>四大消息中间件: RabbitMQ / Kafka  / ActiveMQ / RocketMQ</p>
<p>binder 对象负责与消息中间件交互</p>
<p>INPUT: 消费者</p>
<p>OUTPUT: 生产者</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210312152602441.png" alt="image-20210312152602441"></p>
<h2 id="15-spring-cloud-sleuth-分布式请求链路跟踪">15. Spring Cloud Sleuth 分布式请求链路跟踪</h2>
<p>linux 服务器 启动 zipkin 访问 http://47.115.139.117:9411/</p>
<p>provider 和 consumer 添加依赖: spring-cloud-starter-zipkin</p>
<p>配置:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">spring</span>:
  <span style="color:#f92672">zipkin</span>:
    <span style="color:#f92672">base-url</span>: <span style="color:#ae81ff">http://47.115.139.117:9411/</span>
    <span style="color:#f92672">sleuth</span>:
      <span style="color:#f92672">sampler</span>:
        <span style="color:#f92672">probability</span>: <span style="color:#ae81ff">1</span>
</code></pre></div><h2 id="16-spring-cloud-alibaba-入门简介">16. Spring Cloud Alibaba 入门简介</h2>
<p>Sentinel</p>
<p>Nacos</p>
<p>RocketMQ</p>
<p>Dubbo</p>
<p>Seata</p>
<p>Alibaba Cloud OSS</p>
<p>Alibaba Cloud SchedulerX</p>
<h2 id="17-spring-cloud-alibaba-nacos-服务注册和配置中心">17. Spring Cloud Alibaba Nacos 服务注册和配置中心</h2>
<p>Nacos = Eureka + Config + Bus</p>
<p>docker 安装:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">docker pull nacos/nacos-server:1.1.4  //稳定版，无权限
docker pull nacos/nacos-server:1.3.1  //稳定版，有权限

mkdir -p /home/dockerdata/nacos/logs
mkdir -p /home/dockerdata/nacos1.3.1/logs

<span style="color:#75715e"># 运行镜像  默认账号密码：nacos/nacos</span>

<span style="color:#75715e">#1.1.4</span>
docker run -d <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e PREFER_HOST_MODE<span style="color:#f92672">=</span>ip <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e MODE<span style="color:#f92672">=</span>standalone <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e SPRING_DATASOURCE_PLATFORM<span style="color:#f92672">=</span>mysql <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e MYSQL_MASTER_SERVICE_HOST<span style="color:#f92672">=</span>172.168.1.33 <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e MYSQL_MASTER_SERVICE_PORT<span style="color:#f92672">=</span><span style="color:#ae81ff">3306</span> <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e MYSQL_MASTER_SERVICE_USER<span style="color:#f92672">=</span>root <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e MYSQL_MASTER_SERVICE_PASSWORD<span style="color:#f92672">=</span>root <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e MYSQL_MASTER_SERVICE_DB_NAME<span style="color:#f92672">=</span>nacos <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e MYSQL_SLAVE_SERVICE_HOST<span style="color:#f92672">=</span>172.168.1.33 <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-e MYSQL_SLAVE_SERVICE_PORT<span style="color:#f92672">=</span><span style="color:#ae81ff">3306</span> <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-v /home/dockerdata/nacos/logs:/home/nacos/logs <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-p 8848:8848 <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>--name nacos <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>--restart<span style="color:#f92672">=</span>always <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>nacos/nacos-server:1.1.4
 
 
<span style="color:#75715e">#1.3.1</span>
docker run -d <span style="color:#ae81ff">\-</span>e PREFER_HOST_MODE<span style="color:#f92672">=</span>ip <span style="color:#ae81ff">\-</span>e MODE<span style="color:#f92672">=</span>standalone <span style="color:#ae81ff">\-</span>e SPRING_DATASOURCE_PLATFORM<span style="color:#f92672">=</span>mysql <span style="color:#ae81ff">\-</span>e MYSQL_SERVICE_HOST<span style="color:#f92672">=</span>172.168.1.33 <span style="color:#ae81ff">\-</span>e MYSQL_SERVICE_PORT<span style="color:#f92672">=</span><span style="color:#ae81ff">3306</span> <span style="color:#ae81ff">\-</span>e MYSQL_SERVICE_USER<span style="color:#f92672">=</span>root <span style="color:#ae81ff">\-</span>e MYSQL_SERVICE_PASSWORD<span style="color:#f92672">=</span>root <span style="color:#ae81ff">\-</span>e MYSQL_SERVICE_DB_NAME<span style="color:#f92672">=</span>nacos <span style="color:#ae81ff">\-</span>e TIME_ZONE<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;Asia/Shanghai&#39;</span> <span style="color:#ae81ff">\-</span>v /home/dockerdata/nacos1.3.1/logs:/home/nacos/logs <span style="color:#ae81ff">\-</span>p 8848:8848 <span style="color:#ae81ff">\-</span>-name nacos1.3.1 <span style="color:#ae81ff">\-</span>-restart<span style="color:#f92672">=</span>always <span style="color:#ae81ff">\n</span>acos/nacos-server:1.3.1
</code></pre></div><p>二进制包下载地址:</p>
<p><a href="https://github.com/alibaba/nacos/releases/tag/1.1.4">https://github.com/alibaba/nacos/releases/tag/1.1.4</a></p>
<p><a href="https://github.com/alibaba/nacos/releases/download/1.1.4/nacos-server-1.1.4.zip">https://github.com/alibaba/nacos/releases/download/1.1.4/nacos-server-1.1.4.zip</a></p>
<p>Windows 运行 bin 目录下的 statup.cmd</p>
<p>控制台访问地址: http://localhost:8848/nacos/</p>
<p>控制台默认帐户密码: nacos nacos</p>
<p>provider</p>
<p>依赖: spring-cloud-starter-alibaba-nacos-discovery</p>
<p>注解: @EnableDiscoveryClient</p>
<p>配置:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#f92672">spring</span>:
  <span style="color:#f92672">cloud</span>:
    <span style="color:#f92672">nacos</span>:
      <span style="color:#f92672">discovery</span>:
        <span style="color:#f92672">server-addr</span>: <span style="color:#ae81ff">localhost:8848</span>
</code></pre></div><p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210312213838417.png" alt="image-20210312213838417"></p>
<p>nacos 支持 CP / AP 模式切换</p>
<p><img src="https://gitee.com/alexzshl/picbed/raw/master/image-20210312214259372.png" alt="image-20210312214259372"></p>
<p>持久化:</p>
<p>mysql 新建数据库, 例如 nacos-config</p>
<p>运行 nacos conf文件夹下的sql文件, 导入sql数据</p>
<p>配置 conf 文件夹下的 properties 文件</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">spring.datasource.platform<span style="color:#f92672">=</span>mysql

db.num<span style="color:#f92672">=</span><span style="color:#ae81ff">1</span>
db.url.0<span style="color:#f92672">=</span>jdbc:mysql://localhost:3306/nacos_config?characterEncoding<span style="color:#f92672">=</span>utf8&amp;connectTimeout<span style="color:#f92672">=</span>1000&amp;socketTimeout<span style="color:#f92672">=</span>3000&amp;autoReconnect<span style="color:#f92672">=</span>true
db.user<span style="color:#f92672">=[</span>username<span style="color:#f92672">]</span>
db.password<span style="color:#f92672">=[</span>password<span style="color:#f92672">]</span>

</code></pre></div><h2 id="18-spring-cloud-alibaba-sentinel-实现熔断与限流">18. Spring Cloud Alibaba Sentinel 实现熔断与限流</h2>
<p>dashboard: <a href="https://github.com/alibaba/Sentinel/releases">https://github.com/alibaba/Sentinel/releases</a></p>
<p>控制台账号密码: sentinel sentinel</p>
<h2 id="19-spring-cloud-alibaba-seata-处理分布式事务">19. Spring Cloud Alibaba Seata 处理分布式事务</h2>
<h2 id="20-大厂面试题第三季">20. 大厂面试题第三季</h2>

    
      
    
  </article>
<aside class="sidebar">
  <section class="sidebar_inner">
    
    <h2 class="mt-4">Featured Posts</h2>
    <ul>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/java%E7%99%BB%E5%BD%95%E6%8A%80%E6%9C%AF%E6%80%BB%E7%BB%93/" class="nav-link">Java登录技术总结</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/java%E5%90%8E%E7%AB%AF%E6%95%B4%E5%90%88%E5%BE%AE%E4%BF%A1%E7%99%BB%E5%BD%95%E5%8A%9F%E8%83%BD/" class="nav-link">Java后端整合微信登录功能</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/termux/" class="nav-link">Termux</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/activemq/" class="nav-link">ActiveMQ</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/bitwarden/" class="nav-link">Bitwarden</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/centos7/" class="nav-link">CentOS_7</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/docker/" class="nav-link">Docker</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/idea%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7/" class="nav-link">Idea使用技巧积累</a>
      </li>
    </ul>
    <h2 class="mt-4">Recent Posts</h2>
    <ul class="flex-column">
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/java%E7%99%BB%E5%BD%95%E6%8A%80%E6%9C%AF%E6%80%BB%E7%BB%93/" class="nav-link">Java登录技术总结</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/java%E5%90%8E%E7%AB%AF%E6%95%B4%E5%90%88%E5%BE%AE%E4%BF%A1%E7%99%BB%E5%BD%95%E5%8A%9F%E8%83%BD/" class="nav-link">Java后端整合微信登录功能</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/termux/" class="nav-link">Termux</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/activemq/" class="nav-link">ActiveMQ</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/bitwarden/" class="nav-link">Bitwarden</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/centos7/" class="nav-link">CentOS_7</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/docker/" class="nav-link">Docker</a>
      </li>
      <li>
        <a href="https://alexzshl.gitee.io/blog/post/idea%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7/" class="nav-link">Idea使用技巧积累</a>
      </li>
    </ul>
    <div>
      <h2 class="mt-4 taxonomy" id="categories-section">Categories</h2>
      <nav class="tags_nav">
        <a href='https://alexzshl.gitee.io/blog/categories/java/' class="post_tag button button_translucent">
          JAVA
          <span class="button_tally">12</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/linux/' class="post_tag button button_translucent">
          LINUX
          <span class="button_tally">3</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/spring/' class="post_tag button button_translucent">
          SPRING
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/tool/' class="post_tag button button_translucent">
          TOOL
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/web/' class="post_tag button button_translucent">
          WEB
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/book/' class="post_tag button button_translucent">
          BOOK
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/centos/' class="post_tag button button_translucent">
          CENTOS
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/database/' class="post_tag button button_translucent">
          DATABASE
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/devops/' class="post_tag button button_translucent">
          DEVOPS
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/docker/' class="post_tag button button_translucent">
          DOCKER
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/framework/' class="post_tag button button_translucent">
          FRAMEWORK
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/ide/' class="post_tag button button_translucent">
          IDE
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/idea/' class="post_tag button button_translucent">
          IDEA
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/internet/' class="post_tag button button_translucent">
          INTERNET
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/javascript-framework/' class="post_tag button button_translucent">
          JAVASCRIPT-FRAMEWORK
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/json/' class="post_tag button button_translucent">
          JSON
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/lib/' class="post_tag button button_translucent">
          LIB
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/login/' class="post_tag button button_translucent">
          LOGIN
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/maven/' class="post_tag button button_translucent">
          MAVEN
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/messaging/' class="post_tag button button_translucent">
          MESSAGING
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/mysql/' class="post_tag button button_translucent">
          MYSQL
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/orm/' class="post_tag button button_translucent">
          ORM
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/security/' class="post_tag button button_translucent">
          SECURITY
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/springboot/' class="post_tag button button_translucent">
          SPRINGBOOT
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/springcloud/' class="post_tag button button_translucent">
          SPRINGCLOUD
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/springdata/' class="post_tag button button_translucent">
          SPRINGDATA
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/springmvc/' class="post_tag button button_translucent">
          SPRINGMVC
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/ssh/' class="post_tag button button_translucent">
          SSH
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/terminal/' class="post_tag button button_translucent">
          TERMINAL
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/categories/web-framework/' class="post_tag button button_translucent">
          WEB-FRAMEWORK
          <span class="button_tally">1</span>
        </a>
        
        
      </nav>
    </div>
    <div>
      <h2 class="mt-4 taxonomy" id="tags-section">Tags</h2>
      <nav class="tags_nav">
        <a href='https://alexzshl.gitee.io/blog/tags/activemq/' class="post_tag button button_translucent">
          ACTIVEMQ
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/docker/' class="post_tag button button_translucent">
          DOCKER
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/elasticsearch/' class="post_tag button button_translucent">
          ELASTICSEARCH
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/git/' class="post_tag button button_translucent">
          GIT
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/login/' class="post_tag button button_translucent">
          LOGIN
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/maven/' class="post_tag button button_translucent">
          MAVEN
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/mysql/' class="post_tag button button_translucent">
          MYSQL
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/redis/' class="post_tag button button_translucent">
          REDIS
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/ssh/' class="post_tag button button_translucent">
          SSH
          <span class="button_tally">2</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/404/' class="post_tag button button_translucent">
          404
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/aka.ms/' class="post_tag button button_translucent">
          AKA.MS
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/authorized_keys/' class="post_tag button button_translucent">
          AUTHORIZED_KEYS
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/bitwarden/' class="post_tag button button_translucent">
          BITWARDEN
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/centos/' class="post_tag button button_translucent">
          CENTOS
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/consul/' class="post_tag button button_translucent">
          CONSUL
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/debug/' class="post_tag button button_translucent">
          DEBUG
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/design-pattern/' class="post_tag button button_translucent">
          DESIGN-PATTERN
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/docker-compose/' class="post_tag button button_translucent">
          DOCKER-COMPOSE
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/effective-java/' class="post_tag button button_translucent">
          EFFECTIVE-JAVA
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/eureka/' class="post_tag button button_translucent">
          EUREKA
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/feign/' class="post_tag button button_translucent">
          FEIGN
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/fish/' class="post_tag button button_translucent">
          FISH
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/gateway/' class="post_tag button button_translucent">
          GATEWAY
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/google/' class="post_tag button button_translucent">
          GOOGLE
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/hibernate/' class="post_tag button button_translucent">
          HIBERNATE
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/hystrix/' class="post_tag button button_translucent">
          HYSTRIX
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/interface-document/' class="post_tag button button_translucent">
          INTERFACE-DOCUMENT
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/jackson/' class="post_tag button button_translucent">
          JACKSON
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/jpa/' class="post_tag button button_translucent">
          JPA
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/json/' class="post_tag button button_translucent">
          JSON
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/jsr-107/' class="post_tag button button_translucent">
          JSR-107
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/keygen/' class="post_tag button button_translucent">
          KEYGEN
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/messaging/' class="post_tag button button_translucent">
          MESSAGING
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/microsoft/' class="post_tag button button_translucent">
          MICROSOFT
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/nacos/' class="post_tag button button_translucent">
          NACOS
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/nginx/' class="post_tag button button_translucent">
          NGINX
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/npm/' class="post_tag button button_translucent">
          NPM
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/rsa/' class="post_tag button button_translucent">
          RSA
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/security/' class="post_tag button button_translucent">
          SECURITY
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/shell/' class="post_tag button button_translucent">
          SHELL
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/springcloud-alibaba/' class="post_tag button button_translucent">
          SPRINGCLOUD-ALIBABA
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/springmvc/' class="post_tag button button_translucent">
          SPRINGMVC
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/ssh-add/' class="post_tag button button_translucent">
          SSH-ADD
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/ssh-agent/' class="post_tag button button_translucent">
          SSH-AGENT
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/ssh-keygen/' class="post_tag button button_translucent">
          SSH-KEYGEN
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/stackoverflow/' class="post_tag button button_translucent">
          STACKOVERFLOW
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/swagger/' class="post_tag button button_translucent">
          SWAGGER
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/task/' class="post_tag button button_translucent">
          TASK
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/tencent-cloud/' class="post_tag button button_translucent">
          TENCENT-CLOUD
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/termux/' class="post_tag button button_translucent">
          TERMUX
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/vue.js/' class="post_tag button button_translucent">
          VUE.JS
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/vue.js-2/' class="post_tag button button_translucent">
          VUE.JS-2
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/web/' class="post_tag button button_translucent">
          WEB
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/wechat/' class="post_tag button button_translucent">
          WECHAT
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/weixin/' class="post_tag button button_translucent">
          WEIXIN
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/yum/' class="post_tag button button_translucent">
          YUM
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/zookeeper/' class="post_tag button button_translucent">
          ZOOKEEPER
          <span class="button_tally">1</span>
        </a>
        
        <a href='https://alexzshl.gitee.io/blog/tags/zsh/' class="post_tag button button_translucent">
          ZSH
          <span class="button_tally">1</span>
        </a>
        
        
      </nav>
    </div>
  </section>
</aside>

</div>
    </main><svg width="0" height="0" class="hidden">
  <symbol viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" id="facebook">
    <path d="M437 0H75C33.648 0 0 33.648 0 75v362c0 41.352 33.648 75 75 75h151V331h-60v-90h60v-61c0-49.629 40.371-90 90-90h91v90h-91v61h91l-15 90h-76v181h121c41.352 0 75-33.648 75-75V75c0-41.352-33.648-75-75-75zm0 0"></path>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.001 18.001" id="twitter">
    <path d="M15.891 4.013c.808-.496 1.343-1.173 1.605-2.034a8.68 8.68 0 0 1-2.351.861c-.703-.756-1.593-1.14-2.66-1.14-1.043 0-1.924.366-2.643 1.078a3.56 3.56 0 0 0-1.076 2.605c0 .309.039.585.117.819-3.076-.105-5.622-1.381-7.628-3.837-.34.601-.51 1.213-.51 1.846 0 1.301.549 2.332 1.645 3.089-.625-.053-1.176-.211-1.645-.47 0 .929.273 1.705.82 2.388a3.623 3.623 0 0 0 2.115 1.291c-.312.08-.641.118-.979.118-.312 0-.533-.026-.664-.083.23.757.664 1.371 1.291 1.841a3.652 3.652 0 0 0 2.152.743C4.148 14.173 2.625 14.69.902 14.69c-.422 0-.721-.006-.902-.038 1.697 1.102 3.586 1.649 5.676 1.649 2.139 0 4.029-.542 5.674-1.626 1.645-1.078 2.859-2.408 3.639-3.974a10.77 10.77 0 0 0 1.172-4.892v-.468a7.788 7.788 0 0 0 1.84-1.921 8.142 8.142 0 0 1-2.11.593z"
      ></path>
  </symbol>
  <symbol aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="mail">
    <path  d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="calendar">
    <path d="M452 40h-24V0h-40v40H124V0H84v40H60C26.916 40 0 66.916 0 100v352c0 33.084 26.916 60 60 60h392c33.084 0 60-26.916 60-60V100c0-33.084-26.916-60-60-60zm20 412c0 11.028-8.972 20-20 20H60c-11.028 0-20-8.972-20-20V188h432v264zm0-304H40v-48c0-11.028 8.972-20 20-20h24v40h40V80h264v40h40V80h24c11.028 0 20 8.972 20 20v48z"></path>
    <path d="M76 230h40v40H76zm80 0h40v40h-40zm80 0h40v40h-40zm80 0h40v40h-40zm80 0h40v40h-40zM76 310h40v40H76zm80 0h40v40h-40zm80 0h40v40h-40zm80 0h40v40h-40zM76 390h40v40H76zm80 0h40v40h-40zm80 0h40v40h-40zm80 0h40v40h-40zm80-80h40v40h-40z"></path>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="github">
    <path d="M255.968 5.329C114.624 5.329 0 120.401 0 262.353c0 113.536 73.344 209.856 175.104 243.872 12.8 2.368 17.472-5.568 17.472-12.384 0-6.112-.224-22.272-.352-43.712-71.2 15.52-86.24-34.464-86.24-34.464-11.616-29.696-28.416-37.6-28.416-37.6-23.264-15.936 1.728-15.616 1.728-15.616 25.696 1.824 39.2 26.496 39.2 26.496 22.848 39.264 59.936 27.936 74.528 21.344 2.304-16.608 8.928-27.936 16.256-34.368-56.832-6.496-116.608-28.544-116.608-127.008 0-28.064 9.984-51.008 26.368-68.992-2.656-6.496-11.424-32.64 2.496-68 0 0 21.504-6.912 70.4 26.336 20.416-5.696 42.304-8.544 64.096-8.64 21.728.128 43.648 2.944 64.096 8.672 48.864-33.248 70.336-26.336 70.336-26.336 13.952 35.392 5.184 61.504 2.56 68 16.416 17.984 26.304 40.928 26.304 68.992 0 98.72-59.84 120.448-116.864 126.816 9.184 7.936 17.376 23.616 17.376 47.584 0 34.368-.32 62.08-.32 70.496 0 6.88 4.608 14.88 17.6 12.352C438.72 472.145 512 375.857 512 262.353 512 120.401 397.376 5.329 255.968 5.329z"></path>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212" id="gitlab">
    <path d="M12.3 74.7h54L43.3 3c-1-3.6-6.4-3.6-7.6 0L12.3 74.8z" />
    <path d="M12.3 74.7L.5 111c-1 3.2 0 6.8 3 8.8l101.6 74-92.5-119z"/>
    <path d="M105 193.7l-38.6-119h-54l92.7 119z"/>
    <path d="M105 193.7l38.7-119H66.4l38.7 119z"/>
    <path d="M105 193.7l38.7-119H198l-93 119z"/>
    <path d="M198 74.7l11.6 36.2c1 3 0 6.6-3 8.6l-101.5 74 93-119z"/>
    <path d="M198 74.7h-54.3L167 3c1.2-3.6 6.4-3.6 7.6 0L198 74.8z"/> 
  </symbol>
  <symbol viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" id="rss">
    <circle cx="3.429" cy="20.571" r="3.429"></circle>
    <path d="M11.429 24h4.57C15.999 15.179 8.821 8.001 0 8v4.572c6.302.001 11.429 5.126 11.429 11.428z"></path>
    <path d="M24 24C24 10.766 13.234 0 0 0v4.571c10.714 0 19.43 8.714 19.43 19.429z"></path>
  </symbol>
  <symbol viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" id="linkedin">
    <path d="M437 0H75C33.648 0 0 33.648 0 75v362c0 41.352 33.648 75 75 75h362c41.352 0 75-33.648 75-75V75c0-41.352-33.648-75-75-75zM181 406h-60V196h60zm0-240h-60v-60h60zm210 240h-60V286c0-16.54-13.46-30-30-30s-30 13.46-30 30v120h-60V196h60v11.309C286.719 202.422 296.93 196 316 196c40.691.043 75 36.547 75 79.688zm0 0"></path>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 612 612" id="arrow">
    <path d="M604.501 440.509L325.398 134.956c-5.331-5.357-12.423-7.627-19.386-7.27-6.989-.357-14.056 1.913-19.387 7.27L7.499 440.509c-9.999 10.024-9.999 26.298 0 36.323s26.223 10.024 36.222 0l262.293-287.164L568.28 476.832c9.999 10.024 26.222 10.024 36.221 0 9.999-10.023 9.999-26.298 0-36.323z"></path>
  </symbol>
  <symbol viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" id="carly">
    <path d="M504.971 239.029L448 182.059V84c0-46.317-37.682-84-84-84h-44c-13.255 0-24 10.745-24 24s10.745 24 24 24h44c19.851 0 36 16.149 36 36v108c0 6.365 2.529 12.47 7.029 16.971L454.059 256l-47.029 47.029A24.002 24.002 0 0 0 400 320v108c0 19.851-16.149 36-36 36h-44c-13.255 0-24 10.745-24 24s10.745 24 24 24h44c46.318 0 84-37.683 84-84v-98.059l56.971-56.971c9.372-9.372 9.372-24.568 0-33.941zM112 192V84c0-19.851 16.149-36 36-36h44c13.255 0 24-10.745 24-24S205.255 0 192 0h-44c-46.318 0-84 37.683-84 84v98.059l-56.971 56.97c-9.373 9.373-9.373 24.568 0 33.941L64 329.941V428c0 46.317 37.682 84 84 84h44c13.255 0 24-10.745 24-24s-10.745-24-24-24h-44c-19.851 0-36-16.149-36-36V320c0-6.365-2.529-12.47-7.029-16.971L57.941 256l47.029-47.029A24.002 24.002 0 0 0 112 192z"></path>
  </symbol>
  <symbol viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" id="copy">
    <path d="M23 2.75A2.75 2.75 0 0 0 20.25 0H8.75A2.75 2.75 0 0 0 6 2.75v13.5A2.75 2.75 0 0 0 8.75 19h11.5A2.75 2.75 0 0 0 23 16.25zM18.25 14.5h-7.5a.75.75 0 0 1 0-1.5h7.5a.75.75 0 0 1 0 1.5zm0-3h-7.5a.75.75 0 0 1 0-1.5h7.5a.75.75 0 0 1 0 1.5zm0-3h-7.5a.75.75 0 0 1 0-1.5h7.5a.75.75 0 0 1 0 1.5z"></path>
    <path d="M8.75 20.5a4.255 4.255 0 0 1-4.25-4.25V2.75c0-.086.02-.166.025-.25H3.75A2.752 2.752 0 0 0 1 5.25v16A2.752 2.752 0 0 0 3.75 24h12a2.752 2.752 0 0 0 2.75-2.75v-.75z"></path>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512.001 512.001" id="closeme">
    <path d="M284.286 256.002L506.143 34.144c7.811-7.811 7.811-20.475 0-28.285-7.811-7.81-20.475-7.811-28.285 0L256 227.717 34.143 5.859c-7.811-7.811-20.475-7.811-28.285 0-7.81 7.811-7.811 20.475 0 28.285l221.857 221.857L5.858 477.859c-7.811 7.811-7.811 20.475 0 28.285a19.938 19.938 0 0 0 14.143 5.857 19.94 19.94 0 0 0 14.143-5.857L256 284.287l221.857 221.857c3.905 3.905 9.024 5.857 14.143 5.857s10.237-1.952 14.143-5.857c7.811-7.811 7.811-20.475 0-28.285L284.286 256.002z"></path>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="open-menu">
    <path d="M492 236H20c-11.046 0-20 8.954-20 20s8.954 20 20 20h472c11.046 0 20-8.954 20-20s-8.954-20-20-20zm0-160H20C8.954 76 0 84.954 0 96s8.954 20 20 20h472c11.046 0 20-8.954 20-20s-8.954-20-20-20zm0 320H20c-11.046 0-20 8.954-20 20s8.954 20 20 20h472c11.046 0 20-8.954 20-20s-8.954-20-20-20z"></path>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="instagram">
    <path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id=youtube>
    <path d="M19.615 3.184c-3.604-.246-11.631-.245-15.23 0-3.897.266-4.356 2.62-4.385 8.816.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0 3.897-.266 4.356-2.62 4.385-8.816-.029-6.185-.484-8.549-4.385-8.816zm-10.615 12.816v-8l8 3.993-8 4.007z"/>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="stackoverflow">
    <path d="M21 27v-8h3v11H0V19h3v8h18z"></path><path d="M17.1.2L15 1.8l7.9 10.6 2.1-1.6L17.1.2zm3.7 14.7L10.6 6.4l1.7-2 10.2 8.5-1.7 2zM7.2 12.3l12 5.6 1.1-2.4-12-5.6-1.1 2.4zm-1.8 6.8l13.56 1.96.17-2.38-13.26-2.55-.47 2.97zM19 25H5v-3h14v3z"></path>
  </symbol>
</svg>

<footer class="footer">
  <div class="footer_inner wrap pale">
    <img src='https://alexzshl.gitee.io/blog/icons/apple-touch-icon.png' class="icon icon_2 transparent">
    <p>Copyright<span class="year"></span> ALEXZSHL. All Rights Reserved</p><a class="to_top" href="#documentTop">
  <svg class="icon">
  <use xlink:href="#arrow"></use>
</svg>
</a>

  </div>
</footer>

    <script type="text/javascript" src="https://alexzshl.gitee.io/blog/js/bundle.min.16ce52f0798f54d65cefb0a0fc9228cf99e0b73de57f8a1545fe14259265bf79ba12fe15afd2fd75d5f0bff8f416e8ca8c5c3458f87e014cbfbed8ccfdaee327.js" integrity="sha512-Fs5S8HmPVNZc77Cg/JIoz5ngtz3lf4oVRf4UJZJlv3m6Ev4Vr9L9ddXwv/j0FujKjFw0WPh&#43;AUy/vtjM/a7jJw==" crossorigin="anonymous"></script>
    
  </body>
</html>
